The present invention relates generally to software reusability, and more particularly, to a system and method for porting code written to operate on a native object oriented computer programming system to alternative target object oriented computer programming systems by emulating the native object oriented foundation classes using a porting layer and a template library.
Object Oriented Programming Systems (OOPS) have been developed and are in use in the computer industry to provide a sophisticated and efficient method for modeling real-world objects and for providing the ability to expand and reuse other objects. Objects are complex data structures which model real-world entities, and are associated in classes and identified with their informational features (xe2x80x9cattributesxe2x80x9d) and functional features (xe2x80x9cbehaviorsxe2x80x9d or xe2x80x9cmethodsxe2x80x9d). Objects are effected using object oriented programming languages such as C++. By defining complex, specialized data structures or objects that model real-world entities, software application development is made easier and more natural as the level of abstraction of data is raised to a point where applications can be implemented effectively in the same terms in which they are described by the users of the application. Objects are more readily classifiable into types, which are easily related to one another in subtype/supertype hierarchies. Object oriented programming languages permit the programmer to flexibly define data types so as not to be constrained by limited predefined types. Object oriented programming language types can be associated in classes which can xe2x80x9cinheritxe2x80x9d attributes and/or methods from other classes.
In a sophisticated OOPS, an application framework is developed for use by application programmers as the basis upon which software applications are built. The application framework is a set of classes which provide services necessary to run on a specific operating system. An example of an application framework is the Microsoft(copyright) Foundation Classes developed for the Microsoft(copyright) Windows operating system. The application framework assists the application programmer by removing the application requirements from the operating system requirements by providing an object oriented Application Programming Interface (API). An API can be implemented as an object with attributes and methods which performs services at lower levels in the programming layer hierarchy. An API""s defined attributes are derived from defined data types specific to the operating system. An API""s methods allow an application to access the API""s attributes and also provide services while separating the application from the details unique to the specific operating system. Generally speaking, a particular OOPS manufacturer will provide an application framework and a set of defined APIs to a user or application programmer but will not release the source code which implements the framework and API calls. This practice results in the requirement that all applications written using the application framework and defined APIs of the manufacturer""s computer system be run only on the manufacturer""s or a compatible computer system. As a result, applications cannot be easily ported from one object oriented computer programming system based on one operating system to another object oriented computer programming system based on another operating system. It would be desirable to provide the ability for software applications written for one such object oriented computer programming system to be able to be run on alternative object oriented computer programming systems.
In the prior art, applications designed to run on computers based on one operating system and hardware configuration could be ported to run on another computer running a different operating system and having a different hardware configuration only with expense and difficulty. One method for porting a software application from one system to another involves purchasing an application framework source code license from the OOPS manufacturer to use and alter the source code of the framework to interface properly with the target operating system. This method, however, incurs expense in obtaining the source code license and also requires considerable engineering time for modifying the framework source code to allow for historical differences of data types and complying with the target operating system interface.
Another method for porting a software application from one system to another involves purchasing a source code license from the software application manufacturer to use and alter the source code of the application to interface properly with the target framework. This method, however, also incurs expense in obtaining the application source code license and requires valuable engineering time to modify the application source code to interface correctly with the application framework of the new environment. In addition, this process must be repeated for each new version of the application software that is released and for every application that is to be ported to the other system.
It would be therefore be desirable to provide a system and method for porting applications from one object oriented programming system to another object oriented programming system that requires minimal overhead in cost and engineering time. It would also be desirable to provide a system and method for porting any number of applications from one object oriented programming system to another object oriented programming system for the cost of porting a single application from one system to the other.
Accordingly, the present invention provides an improved method of porting object oriented software applications from one object orient computer programming system to another. The present invention also provides a system and method for porting applications from one object oriented programming system to another object oriented programming system that requires minimal overhead in cost and engineering time. The present invention further provides a system and method for allowing any number of object oriented applications written for the same object oriented programming system (OOPS) to be ported to a different OOPS for the price of porting a single object oriented application from one system to the other.
These and other objects are accomplished in accordance with the present invention by providing a system and method for porting a software application from a native OOPS to a target OOPS, where the native OOPS includes an application framework layer built on a set of defined native foundation classes and an operating system layer running a native operating system and the target OOPS includes an operating system layer running a target operating system different than the native operating system. The software application ported by the present invention is implemented to interface with the native object oriented programming system via application programming interface (API) objects which are instances of the defined native foundation classes. The method of the present invention includes steps for defining a set of target object oriented programming system data types in terms of native object oriented programming system data types, and emulating the native foundation classes using calls to a template library such that the API method calls interface with the target operating system in a functionally equivalent manner as if the application were being run on the native OOPS. The native foundation classes may be emulated by implementing a porting layer in an object oriented programming language. The porting layer may include the set of target object oriented programming system data types, the template library, and a functional procedure implemented for each API method invoked by the native application. Each functional procedure maps a functionality of an API method to calls to routines in the template library. The software application is then recompiled with the porting layer to generate a target executable software application which may be run on the target object oriented programming system. In the preferred embodiment, the porting layer is implemented in the C++ programming language and the template library is the ANSI/ISO C++ Standard Template Libraries.